<div class="bjui-pageHeader" style="background-color: #fefefe; border-bottom: none;">
    <form action="/admin/administration/notice/send-notice-list" data-toggle="ajaxsearch" id="findglobalform" data-options="{
    validate:false,
    searchDatagrid:$.CurrentNavtab.find('#send-notice-list'),

    }">
        <fieldset>
            <legend style="font-weight:normal;">搜索：</legend>
            <div style="margin:0; padding:1px 5px 5px;">
                <span>标题:</span>
                <input name="title" size="10">&nbsp;
                <span>关键字:</span>
                <input name="key_word" size="10">&nbsp;
                <span>起始时间(按添加时间筛选)</span>
                <input type="text" value="" name="start_time" data-toggle="datepicker" placeholder="点击选择日期"
                       data-rule="date">
                <span>结束时间(按添加时间筛选)</span>
                <input type="text" value="" name="end_time" data-toggle="datepicker" placeholder="点击选择日期"
                       data-rule="date">


                <span>状态:</span>
                <select name="is_check" data-toggle="selectpicker">
                    <option value="">全部</option>
                    <option value="0">待审核</option>
                    <option value="1">通过</option>
                    <option value="2">拒绝</option>
                </select>

                <div class="btn-group">
                    <button type="submit" class="btn-green" data-icon="search">查询！</button>

                </div>
            </div>
        </fieldset>
    </form>
</div>
<div class="bjui-pageContent">
    <table class="table table-bordered" id="send-notice-list" data-toggle="datagrid" data-options="{
    height: '100%',

    showToolbar: true,
    fullGrid:true,
    filterThead:false,
    columnMenu:false,
    fieldSortable:false,
    local: 'remote',
    dataUrl:'/admin/administration/notice/send-notice-list',
    editUrl:'/admin/administration/notice/send-notice-list',
    toolbarCustom: toolbar,
    linenumberAll: true
}">
        <thead>
        <th data-options="{name:'title',align:'center',width:70}">标题</th>
        <th data-options="{name:'publisher',align:'center',width:70}">发送者</th>
        <th data-options="{name:'release_time',align:'center',width:70}">发送日期</th>
        <th data-options="{name:'key_word',align:'center',width:70}">关键字</th>
        <th data-options="{name:'attachment_url',align:'center',width:70}">有无附件</th>
        <th data-options="{name:'is_check',align:'center',width:70,items:[{'0':'待审核'},{'1':'通过'},{'2':'拒绝'}]}">状态</th>
        <th data-options="{align:'center',render:operationColumn}">操作</th>
        </thead>
    </table>
</div>
<script>
    function operationColumn(value, data) {
        var html = '';
        if(data.is_check==0) {
            html += '<button type="button" class="btn btn-green" data-toggle="navtab" data-options="{id:\'send-notice-edit\', url:\'/admin/administration/notice/send-notice-edit\', mask:true, width:900, height:400, title:\'编辑通知公告\', data:{id:' + data.id + '}}"><i class="fa fa-edit"></i>编辑</button>';
            html += '<button type="button" class="btn btn-red" data-toggle="doajax" data-options="{id:\'app-role-unbind\', url:\'/admin/administration/notice/del-notice\', confirmMsg:\'确定删除？\', fresh:true, title:\'解绑角色\', mask:true, data:{id:' + data.id + '}}"> 删除</button>';
        }else{
            html += '<button type="button" class="btn btn-blue" data-toggle="navtab" data-options="{id:\'notice-administration-edit\', url:\'/admin/administration/notice/received-notice-edit\', mask:true, width:900, height:400, title:\'查看通知公告详情\', data:{id:' + data.id + '}}"><i class="fa fa-edit"></i>查看详情</button>';
        }
//        html += '<button type="button" class="btn btn-red bjui-datagrid-btn delete"  data-toggle="del.datagrid.tr" ><i class="fa fa-remove"></i>删除</button>';
        return html;
    }
    function toolbar() {
        var html = '<button type="button" class="btn btn-blue"  data-toggle="navtab" data-options="{id:\'send-notice-add\', url:\'/admin/administration/notice/send-notice-add\', title:\'发表通知公告\',width:900,height:400,data:{addFlag:1}, mask:true}"><i class="fa fa-plus"></i> 发表通知公告</button>';
        return html;
    }


</script>